import request from '@/config/axios'

export interface VideoVO {
  id: number
  name: string
  keywords: string
  source: string
  nationSortId: string
  nationSortName: string
  readSortId: string
  readSortName: string
  fileFormat: string
  pdfSite: string
  coverSite: string
  description: string
}

export interface VideoPageReqVO extends PageParam {
  name?: string
  keywords?: string
  createTime?: Date[]
}

// 查询列表
export const getVideoPage = (params: VideoPageReqVO) => {
  return request.get({ url: '/repository-video/page', params })
}

// 查询详情
export const getVideo = (id: number) => {
  return request.get({ url: '/repository-video/get?id=' + id })
}

// 新增
export const createVideo = (data: VideoVO) => {
  return request.post({ url: '/repository-video/create', data })
}

// 修改
export const updateVideo = (data: VideoVO) => {
  return request.put({ url: '/repository-video/update', data })
}

// 删除
export const deleteVideo = (id: number) => {
  return request.delete({ url: '/repository-video/delete?id=' + id })
}

// 导出
export const exportVideo = async (params) => {
  return await request.download({ url: '/repository-video/export', params })
}
